Skip to content

[WIK-2057] Replace writable bind mounts with named volumes - #421

Open
tosfos wants to merge 2 commits into
masterfrom
WIK-2057
Open

tosfos wants to merge 2 commits into
masterfrom
WIK-2057

Conversation

@tosfos

@tosfos tosfos commented Aug 23, 2026

Copy link
Copy Markdown

Jira: https://wikiteq.atlassian.net/browse/WIK-2057

Summary

  • Convert all writable state in the Taqasta compose files to Docker named volumes: taqasta_db_data (MySQL datadir, previously mysql) and taqasta_mw_volume (MediaWiki volume, previously mediawiki). Volume names are pinned via name: so data survives compose project renames and multi-wiki hosts can address volumes deterministically.
  • Keep read-only configuration/test mounts as bind mounts on purpose (e2e LocalSettings.php, Playwright config/tests/fixtures, dev logstest viewer, dev LocalSettings). The e2e playwright-report output mount was dropped from the CI/e2e stack; copy reports out of the container instead.
  • Add scripts/migrate-binds-to-volumes.sh: POSIX sh, shellcheck-clean, idempotent, dry-run by default (--apply to execute). It stops the stack (docker compose stop, containers kept), seeds the new named volumes from legacy bind directories (./mysql, ./images by default) with a temporary helper container (rsync when available, cp -a fallback), verifies file counts and exact byte totals, aborts before any destructive step on mismatch, and renames migrated dirs to <name>.migrated-<timestamp> as rollback snapshots. Never deletes data; re-runs never overwrite volume contents.
  • Document client impact/upgrade steps in docs/bind-mounts-to-volumes.md; linked from README.md and docs/README.md.

Scope

Code-side only per WIK-2057 approval. Running the migration on client servers is explicitly out of scope — clients/operators execute the script during their own upgrade window. No server access performed or required for this PR.

Kubernetes deployments are unaffected (PVC-based already).

Overlap note: WIK-2139

WIK-2139 (external Nginx service replacing Apache) is not yet merged and heavily restructures both docker-compose.yml and docker-compose.sample.yml, including the same volume sections this branch touches. This branch is cut from latest master (9381180) as directed, so merging either PR first will produce textual conflicts in the compose files — they are mechanical to resolve (keep nginx service + apply named-volume mapping). Flagging here rather than stacking.

Validation

  • shellcheck -s sh scripts/migrate-binds-to-volumes.sh: clean
  • sh -n scripts/migrate-binds-to-volumes.sh: clean
  • Dry run against a scratch layout simulating a legacy bind deployment (mysql datadir + images dir incl. nested dirs, symlink): correct file counts/byte totals, no filesystem changes
  • Apply-mode test against real Docker named volumes: copy + verification passed, source renamed to .migrated-*
  • Idempotency: re-run into an already-seeded volume left existing data intact
  • docker compose config clean for both changed files (incl. e2e profile)
  • PyYAML parse of both compose files: OK

Test plan

  • Reviewer runs scripts/migrate-binds-to-volumes.sh (dry run) against a staging VPS deployment with legacy bind layout
  • Reviewer runs with --apply, starts stack with updated compose files, verifies wiki + DB intact
  • Confirm CI e2e suite passes with the report-volume change in docker-compose.yml

Replace remaining writable bind mounts in the Taqasta compose files with
Docker named volumes (taqasta_db_data, taqasta_mw_volume); keep read-only
config/test mounts as binds. Add scripts/migrate-binds-to-volumes.sh, an
idempotent, dry-run-by-default tool that stops the stack, seeds the new
volumes from legacy bind directories via a helper container, verifies file
counts and byte totals, and renames migrated dirs as rollback snapshots.

Document client upgrade steps in docs/bind-mounts-to-volumes.md. Code-side
only per WIK-2057 approval: running the migration on client servers is out
of scope. Kubernetes deployments are unaffected.

https://wikiteq.atlassian.net/browse/WIK-2057
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 439a6832-2aef-4b43-a7d3-1da6b7ef8f4f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…arifications

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

🐳 The image based on 6b625af0 commit has been built with 1.43.8-20260823-421 tag as ghcr.io/wikiteq/taqasta:1.43.8-20260823-421

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant